﻿@model MMPS.Entity.ViewModel.CardLevelsViewModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/Easy UI/themes/icon.css" rel="stylesheet" />
    <link href="~/Content/Easy UI/themes/default/easyui.css" rel="stylesheet" />
    <script src="~/Content/Easy UI/script/jquery-1.11.1.js"></script>
    <script src="~/Content/Easy UI/script/jquery.easyui.min.js"></script>
    <script src="~/Content/Easy UI/script/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn_submit").click(function () {
                //首先点击找到路径
                var url = "/CardLevels/InsertCardLeves/";
                //判断   如果ID大于零，则进入修改页面修改信息
                if (parseInt($("#CL_ID").val()) > 0) {
                    url = "/CardLevels/UpdateCardLevesList/";
                }
                //获取文本框中的信息
                var dataFrom = $("#Form_Card").serializeArray();
                $.post(url, dataFrom, function (data) {
                    if (data.ResultStatus == 1) {
                        window.parent.$.messager.alert("温馨提示", data.Msg, "info");
                        //重新加载列表，找到父类
                        window.parent.$("#dg_CardLevels").datagrid("reload");
                        window.parent.$("#dlg").dialog("close");
                    } else { window.parent.$.messager.alert("温馨提示", data.Msg, "Error"); }
                }, "json");
            })
        })
    </script>
    <title>添加会员</title>
</head>
<body>
    @using (Html.BeginForm("", "", FormMethod.Post, new { id = "Form_Card" }))
    {
        <fieldset style="width:600px;border:1px solid blue">
            <legend>会员基本信息</legend>
            <table>
                <tr>
                    <td>等级名称：</td>
                    <td>@Html.EditorFor(model => model.CL_LevelName, new { htmlAttributes = new { @class = "easyui-textbox" } })</td>
                    <td>需要最大积分：</td>
                    <td>@Html.EditorFor(model => model.CL_NeedPoint, new { htmlAttributes = new { @class = "easyui-textbox" } })</td>
                </tr>
                <tr>
                    <td>积分比例：</td>
                    <td>@Html.EditorFor(model => model.CL_Percent, new { htmlAttributes = new { @class = "easyui-textbox" } })</td>
                    <td>折扣比例：</td>
                    <td>@Html.EditorFor(model => model.CL_Point, new { htmlAttributes = new { @class = "easyui-textbox" } })</td>
                </tr>

                <tr>
                    <td></td>
                    <td>
                        <input type="button" value="提交" class="easyui-linkbutton" id="btn_submit" />
                    </td>
                </tr>
            </table>
            @Html.HiddenFor(model => model.CL_ID, new { htmlAttributes = new { @class = "easyui-textbox" } })
        </fieldset>
    }
</body>
</html>